package br.com.dev.tcc.util;

import android.content.Context;
import android.content.Intent;
import android.location.LocationManager;
import android.provider.Settings;

public class GpsUtil {

	private LocationManager lm;

	public GpsUtil(LocationManager lm) {

		this.lm = lm;
	}

	public GpsUtil(Context ctx) {

		this.lm = (LocationManager) ctx
				.getSystemService(Context.LOCATION_SERVICE);
	}

	public boolean isGpsEnabled() {

		return lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
	}

	public boolean isGpsNetEnabled() {

		return lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
	}

	public static Intent getGpsSettingsIntent() {

		return new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
	}
}
